
void primIdentical()
{
	popNandPush( 2, peek(0) == peek(1) ? true : false );
}

void primClass()
{
	int o = peek(0);

	popNandPush( 1, classOf(o) );
}

void primClone()
{
	int original = peek(0);
	int copy = clone(original);
	
	//printFullObject(original);
	//printFullObject(copy);
	//PANIC("!");
	
	popNandPush( argumentCount+1, copy );
}

int packString(char* s)
{
	int len = strlen(s);
	int obj = instantiateN(String, len);
	
	memcpy( (void*)(obj+4), s, len );
	
	return obj;
}

void primGetAttribute()
{
	int index = unpackSmInt(peek(0));
	
	if(!success)return;
	
	int attr;
	
	switch(index)
	{
		case 1001:  attr = packString("Oceania"); break; //platformName
		case 1002:  attr = packString("1"); break; //platformVersion
		case 1004:  attr = packString("1"); break; //vmVersion
		default:
			printf("%d ", index);
			PANIC("other attribute");
	}
	
	popNandPush( argumentCount+1, attr );
}
